package 线程的学习.udp和tcp的学习;

import java.io.DataInputStream;
import java.io.DataOutput;
import java.io.DataOutputStream;
import java.io.IOException;
import java.net.Socket;
import java.net.UnknownHostException;
import java.util.Scanner;

public class Test_Client {
    Socket socket=null;
    DataOutput dos=null;
    DataInputStream dis=null;
   /* public void run(){

    }*/
//    服务器的连接程序
    public void connect(){
        try {
            String s;
            Scanner scanner=new Scanner(System.in);
            s=scanner.nextLine();
            socket =new Socket("127.0.0.1",8888);
            dos=new DataOutputStream(socket.getOutputStream());
            dos.writeUTF(s);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
    /*public void disconnect(){
        try{
        }catch (Exception e){
            e.printStackTrace();
        }
    }*/
  public static void main(String[] args) {
      Test_Client test_client=new Test_Client();
      test_client.connect();
  }
}
